package com.xihuanjun.sdk.dao;

import com.xihuanjun.sdk.entity.JSTPurchaseinOrder;
import com.xihuanjun.sdk.entity.JSTResult;
import com.xihuanjun.sdk.enums.JSTMethod;
import com.xihuanjun.sdk.util.JsonUtils;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.HashMap;

/**
 * Copyright (C), 2024-09-27
 * FileName: JSTPurchaseinDao
 * Author:   溪浣君
 * Date:     2024-09-27 10:31
 * Description: 聚水潭采购入库
 */
@Component
public class JSTPurchaseinDao extends BaseDao {

    /**
     * 上传采购入库
     * @param order
     * @throws IOException
     */
    public void upload(JSTPurchaseinOrder order) throws IOException {
        String s = doRequest(JSTMethod.JST_PURCHASEIN_UPLOAD.getMethodName(), JsonUtils.object2Json(order));
        JSTResult result=getResult(s,false);
        if(result.getSuccess()==false){
            throw new RuntimeException(result.getMsg());
        }
    }
}
